﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using BuXiaChu.OrderDishes.BLL.WebRuntime;

namespace BuXiaChu.OrderDishes.Web.CallCenter.Order
{
    /// <summary>
    /// $codebehindclassname$ 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class GetDate : HttpHandlerBase, IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            base.Init(context);
            AjaxActionResult result = new AjaxActionResult();
            result.obj = new
            {
                order = new
                {
                    date = DateTime.Now.ToString("yyyy-MM-dd"),
                    hour = DateTime.Now.ToString("HH"),
                    minute = DateTime.Now.ToString("mm")
                },
                dinner = new
                {
                    date = DateTime.Now.AddMinutes(40).ToString("yyyy-MM-dd"),
                    hour = DateTime.Now.AddMinutes(40).ToString("HH"),
                    minute = DateTime.Now.AddMinutes(40).ToString("mm")
                }
            };
            SerializeDataToResponseStream(result);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
